package example;

import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * @Author: luobiao
 * @Date: 2024/3/9 14:05
 * @Description:
 */
@RestController
@Tag(name="user",description = "描述")
@Api(description = "代理商对账", tags = "cl-AgentReconciliationController", basePath = "v1/agentReconciliation", produces = "代理商对账相关接口")
public class UserController {
    @Operation(summary = "根据id获取代理商对账详情",parameters = {
            @Parameter(name = "type", description = "类型参数"),
            @Parameter(name = "time", description = "查询的时间范围")
    })
    @GetMapping(value = "getUser")
    public User  getUser(String type, Date time ){

        return  new User("luobiao",23);
    }

    @ApiResponses(value = {@ApiResponse(description = "successful operation", content = {@Content(mediaType = "application/json", schema = @Schema(implementation = User.class)), @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class))})})

    @Operation(summary = "根据id获取代理商对账详情"
    )
    @GetMapping(value = "getUserList")
    public List getUserList(@RequestBody() ParamsVo paramsVo) {
        User user1 = new User("luobiao", 23);
        User user2 = new User("luobiao", 24);
        return Arrays.asList(user1, user2);
    }

    @PostMapping(value = "saveUser")
    public void   saveUser(@Valid @RequestBody() User user){
        System.out.printf("user=", user);
        return;
    }


}
